<?php

namespace App\Models\V6;
use Illuminate\Database\Eloquent\Model;


class BannersModel extends Model
{


    protected $table = 'banners';

    public function get_banners($type)
    {
        $colum = [
            'banner_img as img',
            'content_id',
            'content_type as type',
            'banner_title',
            'content_type',
            'link'
        ];

        $banners = $this->select($colum)
            ->where('is_show',1)
            ->whereNull('deleted_at')
            ->where('banner_type',$type)
            ->orderby('sort')
            ->get();
        return $banners;
    }

}
